

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link type="text/css" rel="stylesheet" href="${createLinkTo(dir:'css/csslxh',file:'lxh.css')}">
	<script type="text/javascript" src="${createLinkTo(dir:'FCKeditor',file:'fckeditor.js')}"></script> 
	<title>Edit RichNote</title>
</head>

<script language="javascript">
function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function doCheck()
{
	if(trim(document.getElementById("title").value) == '')
	{
    	alert('标题不能为空');
    	return false;		
	}
	if(trim(document.getElementById("ordernum").value) == '')
	{
    	alert('排序不能为空');
    	return false;		
	}
    var oEditor = FCKeditorAPI.GetInstance("content");  
    if( trim(oEditor.EditorDocument.body.innerText) == '' )
    {
    	alert('内容不能为空');
    	return false;
    }
}
</script>

<body style="margin:0; overflow:auto">

<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="${createLinkTo(dir:'imagesmain',file:'grayListBg.gif')}">
  <tr>       
	<td width="50%" style="padding-top:2px;padding-left:10px;padding-right:15px" nowrap>
		<img src="${createLinkTo(dir:'imageslxh',file:'post.gif')}">
		修改内容
	</td>
	<td>&nbsp;</td>		
  </tr>  
</table>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>

<g:hasErrors bean="${richNoteInstance}">
	<div class="errors">
		<g:renderErrors bean="${richNoteInstance}" as="list" />
	</div>
</g:hasErrors>

<g:form action="update" method="post" >
    <input type="hidden" name="flag" value="${flag}">
	<input type="hidden" name="id" value="${richNoteInstance?.id}" />
	<input type="hidden" name="version" value="${richNoteInstance?.version}" />
	
	<table width="800" align="center">
	  
	    <tr>
	    	<td> 
	    	               
	        	<table width="100%" align="center">
	            	<tbody>
	                
	                            <tr>
	                                <td>
	                                    <label for="title">标题:</label>
	                                    <input type="text" maxlength="100" size="50" id="title" name="title" value="${fieldValue(bean:richNoteInstance,field:'title')}" class="text999"/>
	                                </td>
	                            </tr> 
	                            
	                            <tr>
	                                <td>
	                                    <label for="ordernum">排序:</label>
	                                    <input type="text" maxlength="10" id="ordernum" name="ordernum" value="${fieldValue(bean:richNoteInstance,field:'ordernum')}" class="text999"/>
	                                </td>
	                            </tr>
	                
	                            <tr>
	                                <td>
	                                    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 300px">${fieldValue(bean:richNoteInstance, field:'content')}</textarea>
										<script type="text/javascript">
											var oFCKeditor = new FCKeditor('content') ;
											oFCKeditor.BasePath = "../../FCKeditor/" ;
											oFCKeditor.Height = 300;
											oFCKeditor.ToolbarSet = "Lxhbar" ; //Default, Basic 
											oFCKeditor.ReplaceTextarea();
										</script> 	                                 
	                                </td>
	                            </tr> 	              
	                
	                </tbody>
	            </table>
	
	    	</td>
	    </tr>
	            

	    <tr>
	    	<td align="right" style="padding-right:20px">
	    		<input type="submit" value="<g:message code='lxh.btn.update'/>" class="btnGray" onclick="return doCheck()">&nbsp;
	    		<input type="button" value="<g:message code='lxh.btn.cancel'/>" class="btnGray" onclick="history.back()">
	    	</td>
	    </tr>
	</table>
</g:form>

                  

</body>
</html>
